<?php
class ORMv1sample extends ORMBase {
  public function __construct() {
    parent::__construct('v1sample');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->name = isset($object->name) ? $object->name : '';
    $epObject->price = isset($object->price) ? $object->price : 0;
    $epObject->unit = isset($object->unit) ? $object->unit : '';
    $epObject->type = isset($object->type) ? $object->type : '';
    $epObject->model = isset($object->model) ? $object->model : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->name = $epObject->name;
    $object->price = $epObject->price;
    $object->unit = $epObject->unit;
    $object->type = $epObject->type;
    $object->model = $epObject->model;
    return $object;
  }
}
?>
